import AuthRoute from "@/components/AuthRoute";
import Login from "@/pages/Login";
import NotFound from "@/pages/NotFound";
import React from "react";

// 路由懒加载
const Home = React.lazy(() => import("@/pages/Home"));

// 配置路由表
const router = [
  {
    path: "/",
    element: (
      <AuthRoute allowed={true} redirectTo="/login">
        <Home/>
      </AuthRoute>
    ),
    children: [],
  },
  {
    path: "/login",
    element: (
      <AuthRoute allowed={false} redirectTo="/">
        <Login />
      </AuthRoute>
    ),
  },
  {
    path: "*",
    element: <NotFound />,
  },
];

export default router;
